package com.ezops.dao;

import java.io.Serializable;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.ezops.dao.generics.dao.hibernate.GenericDAOImpl;
import com.ezops.dao.generics.search.Search;
import com.ezops.models.TradeExceptions;

/**
 * Access the data pertaining to the trade exceptions.
 * 
 * @author vgaurav
 * 
 */
@Repository
public class ExceptionReportDAO extends
		GenericDAOImpl<TradeExceptions, Serializable> {

	/**
	 * Return all exceptions being raised for the given client and asset type.
	 * TODO - Other filers like DATE, FILE NAME , TRADE ID, ACTION will be added
	 * in future.
	 * 
	 * @param clientId
	 * @param asetClassId
	 * @return
	 */
	public List<TradeExceptions> getAllExceptions(Integer clientId) {
		Search searchCriteria = new Search();
		searchCriteria.addFilterEqual("clientId", clientId);
		//searchCriteria.addFilterEqual("assetId", asetClassId);
		return search(searchCriteria);
	}

}
